package cn.edu.nju.software.android.model;


import java.io.Serializable;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;


public class Geo implements Serializable{

	private static final long serialVersionUID = -1041112281126591979L;
	private String latitude;
	private String longtitude;
	private String city_name;
	private String province_name;
	private String address;

	public Geo(JSONObject json){
		try {
			if(!json.isNull("coordinates")){
				JSONArray array = json.getJSONArray("coordinates");
				latitude = array.getDouble(0)+"";
				longtitude = array.getDouble(1)+"";
			}
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

	public String getLatitude() {
		return latitude;
	}
	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}
	public String getLongtitude() {
		return longtitude;
	}
	public void setLongtitude(String longtitude) {
		this.longtitude = longtitude;
	}
	public String getCity_name() {
		return city_name;
	}
	public void setCity_name(String city_name) {
		this.city_name = city_name;
	}
	public String getProvince_name() {
		return province_name;
	}
	public void setProvince_name(String province_name) {
		this.province_name = province_name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

}
